package com.sykj.qiaoli.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sykj.qiaoli.bean.casea.Law;
import com.sykj.qiaoli.mapper.Casemapper.CaseSealApplyforMapper;
import com.sykj.qiaoli.mapper.Casemapper.LawMapper;
import com.sykj.qiaoli.service.LawService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @program: lawfirm
 * @description:案件信息实现类
 * @author: qiaoli
 * @create: 2020-05-15 15:16
 */
@Service
public class LawServiceImpl extends ServiceImpl<LawMapper, Law> implements LawService {
    @Override
    public Law queryByid(Integer lawId) {
        return this.baseMapper.selectById(lawId);
    }



    @Override
    public List<Law> queryAll(Map<String,Object> map) {
        return this.baseMapper.queryAll(map);
    }

    @Override
    public boolean updataBystatus(Map<String, Object> map) {
        String status = (String) map.get("Status");
        Integer[] i= (Integer[]) map.get("array");
        boolean b=false;
        if("Y".equals(status)){
            int num = this.baseMapper.updateStatusByY(i);
            if(num==i.length){
                b=true;
            }
        }else  if ("O".equals(status)){
            int num = this.baseMapper.updateStatusByO(i);
            if(num==i.length){
                b=true;
            }
        }
        return b;
    }
}
